﻿using System;
using Macds.Core.XML.Excel;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Macds.Test.Core.XML.Excel
{
    [TestClass]
    public class ExcelApplicationTest
    {
        [TestMethod]
        public void CreateExcelFileTest()
        {
            ExcelApplication app = new ExcelApplication();

            app.Worksheets.Add(new ExcelWorksheet());
            app.Worksheets[0].Name = "ExcelDemo";
            
            // Add the rows
            app.Worksheets[0].Rows.Add(new ExcelRow(new object[] { "NAME", "LASTNAME", "COUNTRY" }));
            app.Worksheets[0].Rows.Add(new ExcelRow(new object[] { "Marco", "Castillo", "Panamá" }));
            app.Worksheets[0].Rows.Add(new ExcelRow(new object[] { "Jayson", "Quintero", "Panamá" }));
            app.Worksheets[0].Rows.Add(new ExcelRow(new object[] { "Invitado", "Desconocido", "Argentina" }));

            // Create the excel file
            app.FilePath = "C:\\Macds.Framework.Demo_ExcelXML.xls";
            app.SaveFile();
        }
    }
}
